From: Colin Walters Date: Thu, 6 Aug 2009 23:34:12 +0000 (-0400) Subject: dnd: Fix used of undefined variables X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~11137 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3c87d7674119038fa868c49fa874309e2d16a210;p=gnome-shell.git dnd: Fix used of undefined variables The variables this._yOffset and this._xOffset are included in the drop coordinates, but as far as I can tell never defined. Looking back on the commit that introduced this code, they weren't removed from anywhere else either. The drop coordinates seem correct without them, so just delete them. --- diff --git a/js/ui/dnd.js b/js/ui/dnd.js index c7f753e48..2eb5f789e 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -133,8 +133,8 @@ _Draggable.prototype = { // We can check the return value of the function and break the loop if it's true if we don't want // to continue checking the parents. target._delegate.handleDragOver(this.actor._delegate, actor, - (stageX + this._dragOffsetX + this._xOffset - targX) / target.scale_x, - (stageY + this._dragOffsetY + this._yOffset - targY) / target.scale_y, + (stageX + this._dragOffsetX - targX) / target.scale_x, + (stageY + this._dragOffsetY - targY) / target.scale_y, event.get_time()); } target = target.get_parent(); @@ -163,8 +163,8 @@ _Draggable.prototype = { if (target._delegate && target._delegate.acceptDrop) { let [targX, targY] = target.get_transformed_position(); if (target._delegate.acceptDrop(this.actor._delegate, actor, - (dropX + this._xOffset - targX) / target.scale_x, - (dropY + this._yOffset - targY) / target.scale_y, + (dropX - targX) / target.scale_x, + (dropY - targY) / target.scale_y, event.get_time())) { // If it accepted the drop without taking the actor, // destroy it.